package com.aim.analysis.yoachim;

import com.aim.analysis.artifact.Strategy;
import com.aim.analysis.records.Game;
import com.aim.analysis.records.Hit;

import java.util.Collections;

/**
 * User: Avraham Shvartzon
 * Date: 7/8/14
 */
public class HitWithDivideGames {

    public final boolean gameWithAlertFirst;
    public Game[] games = new Game[4];
    public HitWithDivideGames(Hit hit) {
        gameWithAlertFirst = hit.gameList.get(1).getKey().strategy == Strategy.ALERT_3_SEC;

        if (!gameWithAlertFirst){
            Collections.swap(hit.gameList, 1,2);
        }

        Game[] games1 = GameSplitter.split(hit.gameList.get(1), 0.5);
        Game[] games2 = GameSplitter.split(hit.gameList.get(2), 0.5);
        games[0] = games1[0];
        games[1] = games1[1];
        games[2] = games2[0];
        games[3] = games2[1];
    }
}
